Skip to content

Conversation

@huangrui199126
Copy link
Contributor

@huangrui199126 huangrui199126 commented Aug 28, 2016

This change is Reviewable

@yukuairoy
Copy link
Contributor

Review status: 0 of 1 files reviewed at latest revision, 5 unresolved discussions.


Problems/src/usr/bin/flattenArray, line 5 [r1] (raw file):

var input = [1, {a: [2, [3]]}, 4, [5, [6]], [[7, ['hi']], 8, 9], 10];
var output = [1, {a: [2, [3]]}, 4, 5, 6, 7, 'hi', 8, 9, 10];
"""

Please add two empty lines below module docstring and above flattenArray().


Problems/src/usr/bin/flattenArray, line 6 [r1] (raw file):

var output = [1, {a: [2, [3]]}, 4, 5, 6, 7, 'hi', 8, 9, 10];
"""
def flattenArray(arr):

Rename function name to flatten_array. Also rename the argument.


Problems/src/usr/bin/flattenArray, line 8 [r1] (raw file):

def flattenArray(arr):
  res = []
# print arr

Please remove this line.


Problems/src/usr/bin/flattenArray, line 10 [r1] (raw file):

# print arr
  for item in arr:
      if type(item) == type([]):

Use isinstance(item, list) as discussed.


Problems/src/usr/bin/flattenArray, line 16 [r1] (raw file):

  return res

print flattenArray([1, {"a": [2, [3]]}, 4, [5, [6]], [[7, ['hi']], 8, 9], 10])

Remove this line. Add a separate unit test class.


Comments from Reviewable

@stonemary
Copy link
Contributor

Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, 5 unresolved discussions.


Comments from Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants